<?php

namespace app\store\controller\apps\dealer;

use app\store\controller\Controller;
use app\store\model\dealer\Order as OrderModel;

/**
 * 分销订单
 * Class Order
 * @package app\store\controller\apps\dealer
 */
class Order extends Controller
{
    /**
     * 分销订单列表
     * @param null $user_id
     * @param int $is_settled
     * @return mixed
     * @throws \think\exception\DbException
     */
    public function index($is_settled = -1, $user_id = null)
    {
        $model = new OrderModel;
        $list = $model->getList($is_settled, $user_id);
//        return json($list);
        return $this->fetch('index', compact('list', 'is_settled'));
    }

    /**
     * 订单导出
     */
    public function export($is_settled)
    {
        return OrderModel::exportList($is_settled);
    }

}